// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   StaticConnectionParam.java

package com.boci.common.handler;

import com.boci.common.constant.RequestTypeConst;
import com.boci.common.util.PropertiesUtil;
import java.io.IOException;
import java.util.Properties;

public class StaticConnectionParam
{

    public static StaticConnectionParam getInstance()
        throws IOException
    {
        try
        {
            if(staticConnectionParam == null)
                staticConnectionParam = new StaticConnectionParam();
        }
        catch(IOException ex)
        {
            throw ex;
        }
        return staticConnectionParam;
    }

    public StaticConnectionParam()
        throws IOException
    {
        try
        {
            if(apiHashProp == null)
                initParamHashMap();
        }
        catch(IOException ex)
        {
            throw ex;
        }
    }

    public void initParamHashMap()
        throws IOException
    {
        try
        {
            apiHashProp = PropertiesUtil.loadPropFromJar("/com/boci/common/resources/config/api_path.config");
        }
        catch(IOException ex)
        {
            throw ex;
        }
    }

    public String getURL(String pRequestType)
        throws IOException
    {
        try
        {
            if(apiHashProp == null)
                initParamHashMap();
        }
        catch(IOException ex)
        {
            throw ex;
        }
        return apiHashProp.getProperty(pRequestType);
    }

    public String getFullURL(String pRequestType)
        throws IOException
    {
        String strAPI = "";
        String strURL = "";
        try
        {
            if(apiHashProp == null)
                initParamHashMap();
            strURL = apiHashProp.getProperty(RequestTypeConst.BOCI_URL);
            strAPI = getURL(pRequestType);
        }
        catch(IOException ex)
        {
            throw ex;
        }
        return (new StringBuilder()).append(strURL).append(strAPI).toString();
    }

    public static Properties getApiHashProp()
    {
        return apiHashProp;
    }

    public static void setApiHashProp(Properties apiHashProp)
    {
        apiHashProp = apiHashProp;
    }

    public static StaticConnectionParam getStaticConnectionParam()
    {
        return staticConnectionParam;
    }

    public static void setStaticConnectionParam(StaticConnectionParam staticConnectionParam)
    {
        staticConnectionParam = staticConnectionParam;
    }

    public String getStrCookies()
    {
        return strCookies;
    }

    public void setStrCookies(String strCookies)
    {
        this.strCookies = strCookies;
    }

    public String getStrEncPass()
    {
        return strEncPass;
    }

    public void setStrEncPass(String strEncPass)
    {
        this.strEncPass = strEncPass;
    }

    private String strCookies;
    private String strEncPass;
    private static Properties apiHashProp;
    private static StaticConnectionParam staticConnectionParam = null;

}
